package algutil.system;

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.Properties;

public class Systeme {

	private static int os;
	public static final int WINDOWS_OS = 1;
	public static final int MAC_OS = 2;

	static {
		if (System.getProperty("os.name").startsWith("Windows")) {
			os = WINDOWS_OS;
		} else {
			os = MAC_OS;
		}
	}

	public static int getOS() {
		return os;
	}

	public static void activerConfigProxyGL() {

		Properties systemProperties = System.getProperties();
		// systemProperties.setProperty("http.proxyHost", "172.16.1.138");
		// systemProperties.setProperty("http.proxyPort", "3128");
		systemProperties.setProperty("http.proxyHost", "wwwsddc.galeries");
		systemProperties.setProperty("http.proxyPort", "3128");
		System.getProperties().put("http.proxyUser", "rRetek");
		System.getProperties().put("http.proxyPassword", "7yaoch");
	}

	public static void copierDansLePressePapier(String msg) {
		Toolkit toolKit = Toolkit.getDefaultToolkit();
		Clipboard cb = toolKit.getSystemClipboard();
		cb.setContents(new StringSelection(msg), null);
	}
}
